<template>
  <div id="app">
    <header class="head">
      <a class="back tl" href="javascript:history.back(-1)">
        <i class="el-icon-arrow-left"></i>
      </a>
      <a href="javascript:;" class="tc">
        <small class="font_18 co_f">其他房产详情</small>
      </a>
    </header>
    <main>
      <section class="detail_status_info" v-if="this.$route.query.OtherHouse==1">
        <header><span>基本信息</span></header>
        <p><label>其他房产名称</label><span>{{listData.fld_3}}</span></p>
        <p><label>详细坐落地</label><span>{{listData.fld_4}}</span></p>
        <p><label>关联房产</label>
        <span>
             <router-link :to='{name: "HouseArchivesdetail",query:{unid:this.items}}' class="relation">
                     <img src="../../../img/house.png"  class="houseimg"/>{{listData.fld_subject}}  
             </router-link>  
        </span>
        </p>
        <p><label>所属部门(分公司)：</label><span>{{listData.fld_5}}</span></p>
        <p><label>面积(m²) *：</label><span>{{listData.fld_11}}</span> </p>
        <p><label>出租面积(m²) *：</label><span>{{listData.fld_16}}</span> </p>
        <p><label>所在层数</label><span>{{listData.fld_20}}</span> </p>
      </section>

      <section class="detail_status_info" v-if="this.$route.query.OtherHouse==2">
        <header><span>基本信息</span></header>
        <p><label>其他房产名称</label><span>{{this.listData.values[3]}}</span></p>
        <p><label>详细坐落地</label><span>{{this.listData.values[4]}}</span></p>
        <p><label>关联房产</label>
        <span>
             <router-link :to='{name: "HouseArchivesdetail",query:{unid:this.items}}' class="relation">
                     <img src="../../../img/house.png" class="houseimg"/>{{listData.fld_subject}}  
             </router-link>  
        </span>
        </p>
        <p><label>所属部门(分公司)：</label><span>{{this.listData.values[5]}}</span></p>
        <p><label>面积(m²) *：</label><span>{{this.listData.values[9]}}</span> </p>
        <p><label>出租面积(m²) *：</label><span>{{this.listData.values[14]}}</span> </p>
        <p><label>所在层数</label><span>{{this.listData.values[12]}}</span> </p>
      </section>
    </main>
  </div>
</template>

<script>
  import {
    ViewDetail,ViewDetail6
  } from '../../../api/api';
  export default {
    data() {
      return {
        listData: {},
      };
    },
    methods: {
      getData() {
        let options = {
          params: {
            unid: this.$route.query.unid
          }
        }
        //调取接口
        ViewDetail(options).then((res) => {
          this.listData = res.fields
             this.items = (this.listData.fld_12.split("|")[1]).split(".")[0]
        })
      },
       getData1() {
        let options = {
          params: {
            name: this.$route.query.name
          }
        }
        //调取接口
        ViewDetail6(options).then((res) => {
             this.listData = res.viewEntries[0]
             this.items = (res.viewEntries[0].values[13].split("|")[1]).split(".")[0]
        })
      }
    },
    mounted() {
      this.getData();
      this.getData1();
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->

<style lang="scss" scoped>
  
</style>
